package org.apache.cordova.api;

import org.json.JSONArray;
import org.json.JSONException;

/**
 * Created with IntelliJ IDEA.
 * User: ckue
 * Date: 11.10.12
 * Time: 17:09
 * To change this template use File | Settings | File Templates.
 */
public class EchoPlugin extends Plugin{
    @Override
    public PluginResult execute(String action, JSONArray args, String callbackId) {
        try {
            System.out.println("in java");
            System.out.println( args.toString() );

            return new PluginResult(PluginResult.Status.OK,args.getString(1));
        } catch (JSONException e) {
            return new PluginResult(PluginResult.Status.ERROR,e.getMessage());
        }
    }
}
